<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>Aria: ArMath Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Aria
   &#160;<span id="projectnumber">2.9.4</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="examples.html"><span>Examples</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('classArMath.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="classArMath-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">ArMath Class Reference<div class="ingroups"><a class="el" href="group__UtilityClasses.html">Utility Classes</a> &#124; <a class="el" href="group__easy.html">Easy Subset of ARIA for Beginners</a></div></div>  </div>
</div><!--header-->
<div class="contents">

<p>Common math operations.  
 <a href="classArMath.html#details">More...</a></p>

<p><code>#include &lt;ariaUtil.h&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:ga1f04eeb3c55892aef6fc179f48eaba18"><td class="memItemLeft" align="right" valign="top">static double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__easy.html#ga1f04eeb3c55892aef6fc179f48eaba18">addAngle</a> (double ang1, double ang2)</td></tr>
<tr class="memdesc:ga1f04eeb3c55892aef6fc179f48eaba18"><td class="mdescLeft">&#160;</td><td class="mdescRight">This adds two angles together and fixes the result to [-180, 180].  <a href="group__easy.html#ga1f04eeb3c55892aef6fc179f48eaba18">More...</a><br /></td></tr>
<tr class="separator:ga1f04eeb3c55892aef6fc179f48eaba18"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga67e1a8742f38e6cfbe48cdb89ab8a740"><td class="memItemLeft" align="right" valign="top">
static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__easy.html#ga67e1a8742f38e6cfbe48cdb89ab8a740">angleBetween</a> (double angle, double startAngle, double endAngle)</td></tr>
<tr class="memdesc:ga67e1a8742f38e6cfbe48cdb89ab8a740"><td class="mdescLeft">&#160;</td><td class="mdescRight">Finds if one angle is between two other angles. <br /></td></tr>
<tr class="separator:ga67e1a8742f38e6cfbe48cdb89ab8a740"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gadd5c8cde271a71c44bbfa0b6376ba1ec"><td class="memItemLeft" align="right" valign="top">static double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__easy.html#gadd5c8cde271a71c44bbfa0b6376ba1ec">atan2</a> (double y, double x)</td></tr>
<tr class="memdesc:gadd5c8cde271a71c44bbfa0b6376ba1ec"><td class="mdescLeft">&#160;</td><td class="mdescRight">Finds the arctan of the given y/x pair.  <a href="group__easy.html#gadd5c8cde271a71c44bbfa0b6376ba1ec">More...</a><br /></td></tr>
<tr class="separator:gadd5c8cde271a71c44bbfa0b6376ba1ec"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae67d9f51653dc489d796b8ffdfd1317d"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae67d9f51653dc489d796b8ffdfd1317d"></a>
static bool&#160;</td><td class="memItemRight" valign="bottom"><b>compareFloats</b> (double f1, double f2, double <a class="el" href="classArMath.html#a97bcee20d8fdb394518c14c9305e6321">epsilon</a>)</td></tr>
<tr class="separator:ae67d9f51653dc489d796b8ffdfd1317d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8d5922e33501cf3cda2107a413306042"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8d5922e33501cf3cda2107a413306042"></a>
static bool&#160;</td><td class="memItemRight" valign="bottom"><b>compareFloats</b> (double f1, double f2)</td></tr>
<tr class="separator:a8d5922e33501cf3cda2107a413306042"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga953ffdd0b569b33cbfd5a8f69cf3c69a"><td class="memItemLeft" align="right" valign="top">static double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__easy.html#ga953ffdd0b569b33cbfd5a8f69cf3c69a">cos</a> (double angle)</td></tr>
<tr class="memdesc:ga953ffdd0b569b33cbfd5a8f69cf3c69a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Finds the cos, from angles in degrees.  <a href="group__easy.html#ga953ffdd0b569b33cbfd5a8f69cf3c69a">More...</a><br /></td></tr>
<tr class="separator:ga953ffdd0b569b33cbfd5a8f69cf3c69a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga8ba5702dba30a0c26b27b86c91550a95"><td class="memItemLeft" align="right" valign="top">static double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__easy.html#ga8ba5702dba30a0c26b27b86c91550a95">degToRad</a> (double deg)</td></tr>
<tr class="memdesc:ga8ba5702dba30a0c26b27b86c91550a95"><td class="mdescLeft">&#160;</td><td class="mdescRight">Converts an angle in degrees to an angle in radians.  <a href="group__easy.html#ga8ba5702dba30a0c26b27b86c91550a95">More...</a><br /></td></tr>
<tr class="separator:ga8ba5702dba30a0c26b27b86c91550a95"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga039288e2f8735206972f51b99ac9f281"><td class="memItemLeft" align="right" valign="top">static double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__easy.html#ga039288e2f8735206972f51b99ac9f281">distanceBetween</a> (double x1, double y1, double x2, double y2)</td></tr>
<tr class="memdesc:ga039288e2f8735206972f51b99ac9f281"><td class="mdescLeft">&#160;</td><td class="mdescRight">Finds the distance between two coordinates.  <a href="group__easy.html#ga039288e2f8735206972f51b99ac9f281">More...</a><br /></td></tr>
<tr class="separator:ga039288e2f8735206972f51b99ac9f281"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a97bcee20d8fdb394518c14c9305e6321"><td class="memItemLeft" align="right" valign="top">static double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArMath.html#a97bcee20d8fdb394518c14c9305e6321">epsilon</a> ()</td></tr>
<tr class="separator:a97bcee20d8fdb394518c14c9305e6321"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a82f8be1c5071b6c35106200c18ca7907"><td class="memItemLeft" align="right" valign="top">static double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArMath.html#a82f8be1c5071b6c35106200c18ca7907">fabs</a> (double val)</td></tr>
<tr class="memdesc:a82f8be1c5071b6c35106200c18ca7907"><td class="mdescLeft">&#160;</td><td class="mdescRight">Finds the absolute value of a double.  <a href="#a82f8be1c5071b6c35106200c18ca7907">More...</a><br /></td></tr>
<tr class="separator:a82f8be1c5071b6c35106200c18ca7907"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga56e81d05c4a713bcc04b0c620b787d50"><td class="memItemLeft" align="right" valign="top">static double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__easy.html#ga56e81d05c4a713bcc04b0c620b787d50">fixAngle</a> (double angle)</td></tr>
<tr class="memdesc:ga56e81d05c4a713bcc04b0c620b787d50"><td class="mdescLeft">&#160;</td><td class="mdescRight">Takes an angle and returns the angle in range (-180,180].  <a href="group__easy.html#ga56e81d05c4a713bcc04b0c620b787d50">More...</a><br /></td></tr>
<tr class="separator:ga56e81d05c4a713bcc04b0c620b787d50"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9da14fe185f50575ae2a73bce973b76c"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a9da14fe185f50575ae2a73bce973b76c"></a>
static long&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArMath.html#a9da14fe185f50575ae2a73bce973b76c">getRandMax</a> ()</td></tr>
<tr class="memdesc:a9da14fe185f50575ae2a73bce973b76c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Maximum of value returned by <a class="el" href="classArMath.html#aa6e0fe8a0dc83eab361e795105f44909" title="Returns a random number between 0 and RAND_MAX on Windows, 2^31 on Linux (see ArUtil::getRandMax()). ">random()</a> <br /></td></tr>
<tr class="separator:a9da14fe185f50575ae2a73bce973b76c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afa27aee1b464a95ffa7ab7a5523cf5c0"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="afa27aee1b464a95ffa7ab7a5523cf5c0"></a>
static bool&#160;</td><td class="memItemRight" valign="bottom"><b>isFinite</b> (float f)</td></tr>
<tr class="separator:afa27aee1b464a95ffa7ab7a5523cf5c0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a39df6466973d785d3bb9f66e1628a04b"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a39df6466973d785d3bb9f66e1628a04b"></a>
static bool&#160;</td><td class="memItemRight" valign="bottom"><b>isFinite</b> (double d)</td></tr>
<tr class="separator:a39df6466973d785d3bb9f66e1628a04b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa6e3fa90a83fef0e18968fa4a9d08f0b"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa6e3fa90a83fef0e18968fa4a9d08f0b"></a>
static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArMath.html#aa6e3fa90a83fef0e18968fa4a9d08f0b">isNan</a> (double d)</td></tr>
<tr class="memdesc:aa6e3fa90a83fef0e18968fa4a9d08f0b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Platform-independent call to determine whether the given double is not-a-number. <br /></td></tr>
<tr class="separator:aa6e3fa90a83fef0e18968fa4a9d08f0b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a113738da7bd6f81d9782cbfa6f263cf8"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a113738da7bd6f81d9782cbfa6f263cf8"></a>
static bool&#160;</td><td class="memItemRight" valign="bottom"><b>isNan</b> (float f)</td></tr>
<tr class="separator:a113738da7bd6f81d9782cbfa6f263cf8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a583fedfac988a59c6abeed473b7db7a8"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a583fedfac988a59c6abeed473b7db7a8"></a>
static double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArMath.html#a583fedfac988a59c6abeed473b7db7a8">log2</a> (double x)</td></tr>
<tr class="memdesc:a583fedfac988a59c6abeed473b7db7a8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Base-2 logarithm. <br /></td></tr>
<tr class="separator:a583fedfac988a59c6abeed473b7db7a8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a659ef1482342a40b844e1a3afa1d3388"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a659ef1482342a40b844e1a3afa1d3388"></a>
static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArMath.html#a659ef1482342a40b844e1a3afa1d3388">pointRotate</a> (double *x, double *y, double th)</td></tr>
<tr class="memdesc:a659ef1482342a40b844e1a3afa1d3388"><td class="mdescLeft">&#160;</td><td class="mdescRight">Rotates a point around 0 by degrees given. <br /></td></tr>
<tr class="separator:a659ef1482342a40b844e1a3afa1d3388"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga6301ec48137480318f9c2c8e06ab3b09"><td class="memItemLeft" align="right" valign="top">static double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__easy.html#ga6301ec48137480318f9c2c8e06ab3b09">radToDeg</a> (double rad)</td></tr>
<tr class="memdesc:ga6301ec48137480318f9c2c8e06ab3b09"><td class="mdescLeft">&#160;</td><td class="mdescRight">Converts an angle in radians to an angle in degrees.  <a href="group__easy.html#ga6301ec48137480318f9c2c8e06ab3b09">More...</a><br /></td></tr>
<tr class="separator:ga6301ec48137480318f9c2c8e06ab3b09"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa6e0fe8a0dc83eab361e795105f44909"><td class="memItemLeft" align="right" valign="top">static long&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArMath.html#aa6e0fe8a0dc83eab361e795105f44909">random</a> (void)</td></tr>
<tr class="memdesc:aa6e0fe8a0dc83eab361e795105f44909"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a random number between 0 and RAND_MAX on Windows, 2^31 on Linux (see ArUtil::getRandMax()).  <a href="#aa6e0fe8a0dc83eab361e795105f44909">More...</a><br /></td></tr>
<tr class="separator:aa6e0fe8a0dc83eab361e795105f44909"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga4ef94ed579aafcf73419b20ecc7a7138"><td class="memItemLeft" align="right" valign="top">static long&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__easy.html#ga4ef94ed579aafcf73419b20ecc7a7138">randomInRange</a> (long m, long n)</td></tr>
<tr class="memdesc:ga4ef94ed579aafcf73419b20ecc7a7138"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a random number between <em>m</em> and <em>n</em>.  <a href="group__easy.html#ga4ef94ed579aafcf73419b20ecc7a7138">More...</a><br /></td></tr>
<tr class="separator:ga4ef94ed579aafcf73419b20ecc7a7138"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5cc85672a327b96f1668aaf8efc58c7a"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArMath.html#a5cc85672a327b96f1668aaf8efc58c7a">roundInt</a> (double val)</td></tr>
<tr class="memdesc:a5cc85672a327b96f1668aaf8efc58c7a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Finds the closest integer to double given.  <a href="#a5cc85672a327b96f1668aaf8efc58c7a">More...</a><br /></td></tr>
<tr class="separator:a5cc85672a327b96f1668aaf8efc58c7a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae00541ce402737e1edfbb1c6f81169d1"><td class="memItemLeft" align="right" valign="top">static short&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArMath.html#ae00541ce402737e1edfbb1c6f81169d1">roundShort</a> (double val)</td></tr>
<tr class="memdesc:ae00541ce402737e1edfbb1c6f81169d1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Finds the closest short to double given.  <a href="#ae00541ce402737e1edfbb1c6f81169d1">More...</a><br /></td></tr>
<tr class="separator:ae00541ce402737e1edfbb1c6f81169d1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaeb05754b7747988dd97a961eaded6830"><td class="memItemLeft" align="right" valign="top">static double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__easy.html#gaeb05754b7747988dd97a961eaded6830">sin</a> (double angle)</td></tr>
<tr class="memdesc:gaeb05754b7747988dd97a961eaded6830"><td class="mdescLeft">&#160;</td><td class="mdescRight">Finds the sin, from angles in degrees.  <a href="group__easy.html#gaeb05754b7747988dd97a961eaded6830">More...</a><br /></td></tr>
<tr class="separator:gaeb05754b7747988dd97a961eaded6830"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a906b3be38482624e6501b617b43b4a6a"><td class="memItemLeft" align="right" valign="top">static double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArMath.html#a906b3be38482624e6501b617b43b4a6a">squaredDistanceBetween</a> (double x1, double y1, double x2, double y2)</td></tr>
<tr class="memdesc:a906b3be38482624e6501b617b43b4a6a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Finds the squared distance between two coordinates.  <a href="#a906b3be38482624e6501b617b43b4a6a">More...</a><br /></td></tr>
<tr class="separator:a906b3be38482624e6501b617b43b4a6a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaaddbe148df227cf5f85aff738379adbc"><td class="memItemLeft" align="right" valign="top">static double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__easy.html#gaaddbe148df227cf5f85aff738379adbc">subAngle</a> (double ang1, double ang2)</td></tr>
<tr class="memdesc:gaaddbe148df227cf5f85aff738379adbc"><td class="mdescLeft">&#160;</td><td class="mdescRight">This subtracts one angle from another and fixes the result to [-180,180].  <a href="group__easy.html#gaaddbe148df227cf5f85aff738379adbc">More...</a><br /></td></tr>
<tr class="separator:gaaddbe148df227cf5f85aff738379adbc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaad297269fc57d48d6ee91e64f2917610"><td class="memItemLeft" align="right" valign="top">static double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__easy.html#gaad297269fc57d48d6ee91e64f2917610">tan</a> (double angle)</td></tr>
<tr class="memdesc:gaad297269fc57d48d6ee91e64f2917610"><td class="mdescLeft">&#160;</td><td class="mdescRight">Finds the tan, from angles in degrees.  <a href="group__easy.html#gaad297269fc57d48d6ee91e64f2917610">More...</a><br /></td></tr>
<tr class="separator:gaad297269fc57d48d6ee91e64f2917610"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Common math operations. </p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a97bcee20d8fdb394518c14c9305e6321"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">double ArMath::epsilon </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<dl class="section return"><dt>Returns</dt><dd>a very small number which can be used for comparisons of floating point values, etc. </dd></dl>

</div>
</div>
<a class="anchor" id="a82f8be1c5071b6c35106200c18ca7907"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static double ArMath::fabs </td>
          <td>(</td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>val</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Finds the absolute value of a double. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">val</td><td>the number to find the absolute value of </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the absolute value of the number </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="actsColorFollowingExample_8cpp-example.html#a13">actsColorFollowingExample.cpp</a>.</dd>
</dl>
</div>
</div>
<a class="anchor" id="aa6e0fe8a0dc83eab361e795105f44909"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static long ArMath::random </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Returns a random number between 0 and RAND_MAX on Windows, 2^31 on Linux (see ArUtil::getRandMax()). </p>
<p>On Windows, rand() is used, on Linux, lrand48(). </p>

</div>
</div>
<a class="anchor" id="a5cc85672a327b96f1668aaf8efc58c7a"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static int ArMath::roundInt </td>
          <td>(</td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>val</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Finds the closest integer to double given. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">val</td><td>the double to find the nearest integer to </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the integer the value is nearest to (also caps it within int bounds) </dd></dl>

</div>
</div>
<a class="anchor" id="ae00541ce402737e1edfbb1c6f81169d1"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static short ArMath::roundShort </td>
          <td>(</td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>val</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Finds the closest short to double given. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">val</td><td>the double to find the nearest short to </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the integer the value is nearest to (also caps it within short bounds) </dd></dl>

</div>
</div>
<a class="anchor" id="a906b3be38482624e6501b617b43b4a6a"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static double ArMath::squaredDistanceBetween </td>
          <td>(</td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>x1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>y1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>x2</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>y2</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Finds the squared distance between two coordinates. </p>
<p>use this only where speed really matters </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">x1</td><td>the first coords x position </td></tr>
    <tr><td class="paramname">y1</td><td>the first coords y position </td></tr>
    <tr><td class="paramname">x2</td><td>the second coords x position </td></tr>
    <tr><td class="paramname">y2</td><td>the second coords y position </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the distance between (x1, y1) and (x2, y2) </dd></dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>ariaUtil.h</li>
<li>ariaUtil.cpp</li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="classArMath.html">ArMath</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.11 </li>
  </ul>
</div>
</body>
</html>
